package com.woniuxy.stage3demo.service.lyl.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.stage3demo.bean.lyl.MailMessageBean;

import com.woniuxy.stage3demo.mapper.lyl.MailMessageMapper;
import com.woniuxy.stage3demo.mapper.lyl.StationMessageMapper;
import com.woniuxy.stage3demo.pageHelper.PageRequest;
import com.woniuxy.stage3demo.service.lyl.IMailMsgService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
@Transactional(readOnly = false)
@Service
public class MailMsgServiceImpl implements IMailMsgService {

    @Resource
    private MailMessageMapper mailMessageMapper;
    @Override
    public PageInfo<MailMessageBean> findAllByParams(PageRequest request,MailMessageBean mailMessageBean) {
        return PageHelper.startPage(request.getPageNum(),request.getLimit()).
                doSelectPageInfo(()-> mailMessageMapper.findAllByParams(request,mailMessageBean));
    }

    @Override
    public void saveMailMessageBean(MailMessageBean mailMessageBean) {

    }

    @Override
    public void deleteOneMailMessageBean(Long id) {
        mailMessageMapper.deleteOneStationMessageBean(id);
    }

    @Override
    public PageInfo<MailMessageBean> selectMailMessageBeanByTitleAndName(PageRequest request, String mailMsgTitle, String name) {
        return null;
    }
}
